package com.csu.mapper;

import com.csu.vo.HomeworkSubjectRespVO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.List;

@Repository
@Mapper
public interface HomeworksMapper {
    /**
     *按学科查询作业列表
     */
    List<HomeworkSubjectRespVO> getSubjectVOList(int subjectId, int userId);

    /**
     * 发布作业
     */
    int insertHomework(int subjectId, String name, String path, int id, Timestamp now);

    /**
     * 获取作业详情
     */
    HomeworkSubjectRespVO getSubjectVOByHomeworkId(int homeworkId);

    /**
     * 查询自己发布的作业列表
     */
    List<HomeworkSubjectRespVO> getSubjectVOByUserId(int id);

    /**
     * 通过homeworkId获取userId
     */
    Integer getUserIdByHomeworkId(int homeworkId);

    /**
     * 老师删除作业
     */
    int deleteHomework(int homeworkId);
}
